const computedBehavior = require('miniprogram-computed').behavior
Page({
    mixins: [require('../../mixins/navbar')],
    behaviors: [computedBehavior],
    data: {
        price: 10,
        obj: {
            a: 1
        }
        // list: [
        //     {
        //         name: '2'
        //     }
        // ]
    },
    watch: {
        price(newVal, oldVal) {
            this.setData({
                sum: newVal
            })
        },
        'obj.**'(newVal) {
            console.log(newVal)
        },
        'list.**'(newVal) {
            console.log(newVal)
        }
    },
    onLoad: function (options) {},
    add() {
        this.setData({
            price: this.data.price + 1,
            'obj.a': 2,
            'list[0]': {
                name: 'ls'
            }
        })
    }
})
